package com.tiger.cloud.enums;

import com.tiger.cloud.common.mybatis.handler.CodeEnum;

/**
 * 通用枚举类型
 */
public enum UserInfoMarriageType implements CodeEnum<UserInfoMarriageType> {

	MARRIED (1, "已婚"), UNMARRIED(0, "未婚"), OTHER(2, "其它");

	private int code;
	private String desc;

	private UserInfoMarriageType(int code, String desc) {
		this.code = code;
	}

	/**
	 * 通过枚举<code>name</code>获取枚举
	 */
	public static UserInfoMarriageType getEnumByCode(Integer code) {
		if (code == null) {
			return null;
		}
		for (UserInfoMarriageType enumm : UserInfoMarriageType.values()) {
			if (enumm.getCode() == code.intValue()) {
				return enumm;
			}
		}
		return null;
	}

	@Override
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

}
